{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "2a289cba",
   "metadata": {},
   "outputs": [],
   "source": [
    "#读入数据\n",
    "import pandas as pd\n",
    "data = pd.read_csv(r\"C:\\Users\\LiJichen\\Desktop\\bosszp-master\\data_csv.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "72dee8ce",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'E:\\\\中国互联网行业工作经验要求占比.html'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#绘制中国互联网行业工作经验要求占比饼状图\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Pie\n",
    "experience_count = data.groupby('job_experience')['job_ave_salary'].count()#平均工资\n",
    "attr = experience_count.reset_index()['job_experience'].tolist()\n",
    "value = experience_count.reset_index()['job_ave_salary'].tolist()\n",
    "my_data_pair = [list(z) for z in zip(attr, value)]\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(bg_color=\"#2c343c\"))\n",
    "    .add(\n",
    "        series_name=\"工作经验\",\n",
    "        data_pair=my_data_pair,\n",
    "        rosetype=None,\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"中国互联网行业工作经验要求占比饼状图\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#fff\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "    .render(\"中国互联网行业工作经验要求占比.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "fcf662e8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['博士', '大专', '学历不限', '本科', '硕士']\n",
      "[207, 5298, 1368, 18440, 2744]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'E:\\\\中国互联网行业学历要求占比.html'"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#绘制中国互联网行业学历要求占比饼状图\n",
    "experience_count = data.groupby('job_education')['job_ave_salary'].count()#平均工资\n",
    "print(experience_count.reset_index()['job_education'].tolist())\n",
    "print(experience_count.reset_index()['job_ave_salary'].tolist())\n",
    "attr = experience_count.reset_index()['job_education'].tolist()\n",
    "value = experience_count.reset_index()['job_ave_salary'].tolist()\n",
    "my_data_pair = [list(z) for z in zip(attr, value)]\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(bg_color=\"#2c343c\"))\n",
    "    .add(\n",
    "        series_name=\"学历\",\n",
    "        data_pair=my_data_pair,\n",
    "        rosetype=None,\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"中国互联网行业学历要求占比饼状图\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#fff\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "    .render(\"中国互联网行业学历要求占比.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "7ad54ecb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['博士', '大专', '学历不限', '本科', '硕士']\n",
      "[8, 33, 29, 922, 236]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'E:\\\\数据挖掘岗位学历要求占比.html'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#绘制数据挖掘行业学历要求占比饼状图\n",
    "experience_count = data.loc[data['job_type']=='数据挖掘'].groupby('job_education').count()#平均工资\n",
    "print(experience_count.reset_index()['job_education'].tolist())\n",
    "print(experience_count.reset_index()['job_ave_salary'].tolist())\n",
    "attr = experience_count.reset_index()['job_education'].tolist()\n",
    "value = experience_count.reset_index()['job_ave_salary'].tolist()\n",
    "my_data_pair = [list(z) for z in zip(attr, value)]\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(bg_color=\"#2c343c\"))\n",
    "    .add(\n",
    "        series_name=\"学历\",\n",
    "        data_pair=my_data_pair,\n",
    "        rosetype=None,\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"数据挖掘岗位学历要求占比\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#fff\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "    .render(\"数据挖掘岗位学历要求占比.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "c32a7e56",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['博士', '大专', '学历不限', '本科', '硕士']\n",
      "[130, 243, 106, 2190, 1038]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'E:\\\\人工智能岗位学历要求占比.html'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#绘制人工智能行业学历要求占比饼状图\n",
    "experience_count = data.loc[data['job_type']=='人工智能'].groupby('job_education').count()#平均工资\n",
    "print(experience_count.reset_index()['job_education'].tolist())\n",
    "print(experience_count.reset_index()['job_ave_salary'].tolist())\n",
    "attr = experience_count.reset_index()['job_education'].tolist()\n",
    "value = experience_count.reset_index()['job_ave_salary'].tolist()\n",
    "my_data_pair = [list(z) for z in zip(attr, value)]\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(bg_color=\"#2c343c\"))\n",
    "    .add(\n",
    "        series_name=\"学历\",\n",
    "        data_pair=my_data_pair,\n",
    "        rosetype=None,\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"人工智能岗位学历要求占比\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#fff\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "    .render(\"人工智能岗位学历要求占比.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "2e56c53a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['大专', '学历不限', '本科', '硕士']\n",
      "[10, 9, 272, 17]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'E:\\\\数据架构师岗位学历要求占比.html'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#绘制数据架构师行业学历要求占比饼状图\n",
    "experience_count = data.loc[data['job_type']=='数据架构师'].groupby('job_education').count()#平均工资\n",
    "print(experience_count.reset_index()['job_education'].tolist())\n",
    "print(experience_count.reset_index()['job_ave_salary'].tolist())\n",
    "attr = experience_count.reset_index()['job_education'].tolist()\n",
    "value = experience_count.reset_index()['job_ave_salary'].tolist()\n",
    "my_data_pair = [list(z) for z in zip(attr, value)]\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(bg_color=\"#2c343c\"))\n",
    "    .add(\n",
    "        series_name=\"学历\",\n",
    "        data_pair=my_data_pair,\n",
    "        rosetype=None,\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"数据架构师岗位学历要求占比\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#fff\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "    .render(\"数据架构师岗位学历要求占比.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "b6bdc8c9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['博士', '大专', '学历不限', '本科', '硕士']\n",
      "[67, 55, 80, 2498, 1335]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'E:\\\\算法工程师岗位学历要求占比.html'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#绘制算法工程师行业学历要求占比饼状图\n",
    "experience_count = data.loc[data['job_type']=='算法工程师'].groupby('job_education').count()#平均工资\n",
    "print(experience_count.reset_index()['job_education'].tolist())\n",
    "print(experience_count.reset_index()['job_ave_salary'].tolist())\n",
    "attr = experience_count.reset_index()['job_education'].tolist()\n",
    "value = experience_count.reset_index()['job_ave_salary'].tolist()\n",
    "my_data_pair = [list(z) for z in zip(attr, value)]\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(bg_color=\"#2c343c\"))\n",
    "    .add(\n",
    "        series_name=\"学历\",\n",
    "        data_pair=my_data_pair,\n",
    "        rosetype=None,\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"算法工程师岗位学历要求占比\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#fff\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "    .render(\"算法工程师岗位学历要求占比.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "f7a5c0a4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['大专', '学历不限', '本科', '硕士']\n",
      "[587, 123, 2839, 7]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'E:\\\\Java岗位学历要求占比.html'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#绘制JAVA行业学历要求占比饼状图\n",
    "experience_count = data.loc[data['job_type']=='Java'].groupby('job_education').count()#平均工资\n",
    "print(experience_count.reset_index()['job_education'].tolist())\n",
    "print(experience_count.reset_index()['job_ave_salary'].tolist())\n",
    "attr = experience_count.reset_index()['job_education'].tolist()\n",
    "value = experience_count.reset_index()['job_ave_salary'].tolist()\n",
    "my_data_pair = [list(z) for z in zip(attr, value)]\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(bg_color=\"#2c343c\"))\n",
    "    .add(\n",
    "        series_name=\"学历\",\n",
    "        data_pair=my_data_pair,\n",
    "        rosetype=None,\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"Java岗位学历要求占比\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#fff\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "    .render(\"Java岗位学历要求占比.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "968ea4d3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['大专', '学历不限', '本科', '硕士']\n",
      "[877, 160, 2332, 6]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'E:\\\\Web前端岗位学历要求占比.html'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#绘制Web前端行业学历要求占比饼状图\n",
    "experience_count = data.loc[data['job_type']=='Web前端'].groupby('job_education').count()#平均工资\n",
    "print(experience_count.reset_index()['job_education'].tolist())\n",
    "print(experience_count.reset_index()['job_ave_salary'].tolist())\n",
    "attr = experience_count.reset_index()['job_education'].tolist()\n",
    "value = experience_count.reset_index()['job_ave_salary'].tolist()\n",
    "my_data_pair = [list(z) for z in zip(attr, value)]\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(bg_color=\"#2c343c\"))\n",
    "    .add(\n",
    "        series_name=\"学历\",\n",
    "        data_pair=my_data_pair,\n",
    "        rosetype=None,\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"Web前端岗位学历要求占比\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#fff\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "    .render(\"Web前端岗位学历要求占比.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "a2a788ea",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['大专', '学历不限', '本科', '硕士']\n",
      "[959, 189, 2079, 7]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'E:\\\\Data\\\\Jupyter\\\\Android岗位学历要求占比.html'"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#绘制Android前端行业学历要求占比饼状图\n",
    "experience_count = data.loc[data['job_type']=='Android'].groupby('job_education').count()#平均工资\n",
    "print(experience_count.reset_index()['job_education'].tolist())\n",
    "print(experience_count.reset_index()['job_ave_salary'].tolist())\n",
    "attr = experience_count.reset_index()['job_education'].tolist()\n",
    "value = experience_count.reset_index()['job_ave_salary'].tolist()\n",
    "my_data_pair = [list(z) for z in zip(attr, value)]\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(bg_color=\"#2c343c\"))\n",
    "    .add(\n",
    "        series_name=\"学历\",\n",
    "        data_pair=my_data_pair,\n",
    "        rosetype=None,\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"Android岗位学历要求占比\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#fff\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "    .render(\"Android岗位学历要求占比.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "5c2b0741",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['大专', '学历不限', '本科', '硕士']\n",
      "[1268, 365, 1726, 2]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'E:\\\\Data\\\\Jupyter\\\\PHP岗位学历要求占比.html'"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#绘制PHP行业学历要求占比饼状图\n",
    "experience_count = data.loc[data['job_type']=='PHP'].groupby('job_education').count()#平均工资\n",
    "print(experience_count.reset_index()['job_education'].tolist())\n",
    "print(experience_count.reset_index()['job_ave_salary'].tolist())\n",
    "attr = experience_count.reset_index()['job_education'].tolist()\n",
    "value = experience_count.reset_index()['job_ave_salary'].tolist()\n",
    "my_data_pair = [list(z) for z in zip(attr, value)]\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(bg_color=\"#2c343c\"))\n",
    "    .add(\n",
    "        series_name=\"学历\",\n",
    "        data_pair=my_data_pair,\n",
    "        rosetype=None,\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"PHP岗位学历要求占比\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#fff\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "    .render(\"PHP岗位学历要求占比.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "97c5a3cb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['大专', '学历不限', '本科', '硕士']\n",
      "[893, 223, 1792, 9]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'E:\\\\Data\\\\Jupyter\\\\iOS岗位学历要求占比.html'"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#绘制iOS行业学历要求占比饼状图\n",
    "experience_count = data.loc[data['job_type']=='iOS'].groupby('job_education').count()#平均工资\n",
    "print(experience_count.reset_index()['job_education'].tolist())\n",
    "print(experience_count.reset_index()['job_ave_salary'].tolist())\n",
    "attr = experience_count.reset_index()['job_education'].tolist()\n",
    "value = experience_count.reset_index()['job_ave_salary'].tolist()\n",
    "my_data_pair = [list(z) for z in zip(attr, value)]\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(bg_color=\"#2c343c\"))\n",
    "    .add(\n",
    "        series_name=\"学历\",\n",
    "        data_pair=my_data_pair,\n",
    "        rosetype=None,\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"iOS岗位学历要求占比\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#fff\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "    .render(\"iOS岗位学历要求占比.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "afdbf3c0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['博士', '大专', '学历不限', '本科', '硕士']\n",
      "[2, 373, 84, 1790, 87]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "'E:\\\\Data\\\\Jupyter\\\\数据分析岗位学历要求占比.html'"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#绘制数据分析行业学历要求占比饼状图\n",
    "experience_count = data.loc[data['job_type']=='数据分析'].groupby('job_education').count()#平均工资\n",
    "print(experience_count.reset_index()['job_education'].tolist())\n",
    "print(experience_count.reset_index()['job_ave_salary'].tolist())\n",
    "attr = experience_count.reset_index()['job_education'].tolist()\n",
    "value = experience_count.reset_index()['job_ave_salary'].tolist()\n",
    "my_data_pair = [list(z) for z in zip(attr, value)]\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(bg_color=\"#2c343c\"))\n",
    "    .add(\n",
    "        series_name=\"学历\",\n",
    "        data_pair=my_data_pair,\n",
    "        rosetype=None,\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"数据分析岗位学历要求占比\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#fff\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "    .render(\"数据分析岗位学历要求占比.html\")\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d050f158",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
